<template>
  <el-color-picker v-model="theme" :size="size" @change="themeChange"
   :predefine="[ '#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#CD1DE4', '#f5222d' ]">
  </el-color-picker>
</template>

<script>
import { changeThemeColor } from '@/assets/plugins/theme-color-client'
export default {
  name: 'theme-picker',
  props: {
    size: {
      type: String,
      default: 'small'
    }
  },
  data() {
    return {
      theme: this.$store.getters.theme
    }
  },
  methods: {
    themeChange() {
      changeThemeColor(this.theme).then(res => this.$message.success('主题色切换成功~'))
    }
  }
}
</script>
<style></style>
